improved close stability

Main menu is now aware of whether it was closed or the login form was
closed- closes app if latter