fix course query