fixing error handling still