fix functions which return result object