adding code to check for interupts. #123