maded the edit tab logic modular with validate method