better error handling, fix verbose mode