Moved render call before object state update to reduce flicker.