Fix hql bug