fixed bug with pausing and quitting