adding some error handling #84