Fix: object of type 'function' has no len()