fix incorrect result handling