fix on_message race