Got rid of error for trying to count NilClass