Corrected error with calling of function as array method