# thmtools with thmbox split in two pages

I am trying to use the thmbox=Moption from the thmtools package. But sometimes in the text when there isn't enough space for the theorem to fit in the bottom of the first page, it moves it to the next page and still splits it further to a third page. I have a minimal example here. I really like the box shape, so if you can give me a solution using the same package, or tell me how to make a boxed theorem like this, I would really appreciate it!

\documentclass{report}
\usepackage{amsthm, amsmath}
\usepackage{blindtext}
\usepackage{thmtools}
\declaretheorem[style=remark, thmbox=M, name=Theorem]{theorem}
\begin{document}

\begin{theorem}
\blindtext[4]
\end{theorem}

\begin{theorem}
Assuming this is true,
$$\label{eq:zeroconf} \sum_{i,j} d_{i,j}^2\|X_i- X_j\|^2=0$$
Then this happens.
\end{theorem}

\end{document}