Fix code example

$collection is undefined and throws an exception if called as function.