modified to stop job safety
add logging at exit