prevent the resize event to be executed continuously