handled edge case where db is empty