syntax fix
Improve error-handling