Detach functions from window