fix to a few queries