validate before edit or remove