Fixed bug with WindowResize