working on handling interrupt in main