exception handling added for login and register windows