fixed document update bug
fixed some realtime issues