Fix edit box empty when entering edit mode