Fixed querycontroller bug