Work on window destroy and process kill