Set cloudid before reference