proper error handling
WIP