validation added to create and edit products