fix to remove plyr dependency.