changed the way the pause attribute is switched