added functionality to both new and create pages.