simplified error handling