really weird safari fix/hack/ugly try catch block