Create realtime functions