validation on Both Add and Edit