changed empty method to check if count is 0