Fixed improper passing of a function