Sorry, was a typo. The bm is there twice, but the 1st one should be only m
So $encode($parms,bm) becomes $encode($parms,m)