fix bug in realtime