working window destruction and probably input events