added validation of f to mcApply