modified just a half a bit the window behaviour