fix issue where default is string
fix issue of recursively calling function
include missing map and each