kill task when window closes
bugs