implement handle_exec