bugfix write_qml (close)