add edit functionality to main models