fixed passed method returning incorrect value