added escaping to prevent javascript from breaking if single quotes existed