pass in anonymous func