added remove window functionality