Fixed var as function error