fix resizing window error