Adding lots of debugging and fixing premature job termination issue