beefed up exception handling in register function gui