Added if else block for programstatus