error handling bugfix