Fixed logic error with switching pause and start