Fix Safari/Chrome crash