fixing query. have no idea how it worked before.