Made logquery properly stop on no results