Fix window not closing through native methods