Fixed null error while pausing