similarity now also deals with keyboard interrupt exception