fixing some bugs on edit buttons.