Small fix for db lib, checking if result of query is empty