Fix invalid method call bug