fixing window behaviour restoration