Fix issue with preview when viewed through localhost