now returning correct value