Code formatting update
Add form checks to add and edit segment pages