Improve error handling when creation fails