fixed random package query when db empty