added realtime functionality