Changes to the new custom leave process flow, fixed few more bugs while
testing