added termination to MASTER
Gracifully terminate MPI in debugger terminate