better escaping to avoid javascript errors