some fixing, mainly to shut application when clicking on the X