handle_msg needs to be a lambda