an attempt at error handling

this is not complete, but a little more informative for the user.