polished error handling logic