fixing condition error l82 and catching interrupt