removed global var "pause"