Correct mistyping error

Replaced the undefined variable $f with the current loyalty $item.