bug fixed again for edit mode