Changed the pause functionality