close box with X works but only for the first try