fix resizing logic for IE11, FireFox, and Safari browsers