better command execution error handling