fixed error - function was treated like a class