handle errors
seems to work