added window resizing support, fixed it also