fixed performance on window resizing