Use error handler
Raise error if command failed to execute
Fix leak