Getting errors in adaptive finite element FF++ code of Heat equation

Dear all experts, i am getting errors in adaptive finite element FF++ code of Heat equation.
Here, is my code>
Heat_adapt.edp (5.5 KB)

Here, is the error>
Error in the def of sub domain 0 form border 4/4: Bad sens 0 -1
Error in the def of sub domain 1 form border 3/4: Bad sens 1 -1
Error in the def of sub domain 2 form border 2/4: Bad sens 2 -1
Error in the def of sub domain 3 form border 1/4: Bad sens 3 -1
Fatal error in the meshgenerator 777
current line = 138
Meshing error: Bamg
number : 777,
catch Err bamg
ffgui: Socket::Read: ffsock: Connection reset by peer
ffgui: FreeFem++ has stopped unexpectedly.

In this code, i have used the adaptmesh code of poisson equation from tutorial example but i have to use space-time adaptive algorithm. How can i do that in this code??.
I will be very grateful if i get any suggestion to avoid this errors.

Thanks in advance!.

Dear all experts, i have done the code still good results is not coming.
Here, is my code>
Heat_adapt_new.edp (7.1 KB)

Thanks in advance!.