Global variable error fixed and resume fixed