query for get_realtime_users modified