changed error handling 2