fixed edit mode bug