make custom nanmean function private