error handling now working