Add cleaner error handling