Fixed issue where pause state was being switched twice