basic error handling

nothing advanced, just simple error management put into place… more
needed