Snatched engine_handle_cmd function