added special treatment for safari resizing