fixed some issues related to editing