I need command for back to work zero while cancel job in UGCS

I am new and used UGCS 1.0.9 to carve with my xcarve can anyone used and carving with success.
if hit Cancel the job while carving machine not moves itself to work zero all axis like easel do back to work zero.
I need manually hit return to zero button in UGCS but it is scaring sometimes.Z axis not lift up and direct moves to work zero. sometimes lift up Z first and back to zero whats going wrong I did not get yet.

I want to know if UGCS back work zero after finishing the job with success all axis moves first Z up and back. why not when hit cancel can anybody give me UGCS command line to back to work zero position while hitting the cancel. I want manually add command line to back work zero with successfully all axis first move Z up and than Y, X and return to work zero and spindle off.

Thanks

First line sets absolute addressing, fast move to Z 0.0
Second line sets absolute addressing, fast move to X 0, Y 0, Z 0
Third line turns the spindle off

G90 G0 Z0.0
G90 G0 X0 Y0 Z0
M5

Thanks for reply I will try these steps