validation is working for edits