adding error checking for creating a section