Fix closeEvent. Add resources.