fix crash when pausing invalid program