improved handling of empty results