Fixing login window autoclose