Fixed error in path of result writing