fix result handling