pause program function working