Fixing bug while creating group

moved form handling inside try block