Modified main form and module to fix problem with GEM layer not being added