Updates to realtime thread function