added check to see if pagename is not null or empty during save operation