adding success and error handlers for commands