Added keyboard interrupt handling for main call