fixed the wrong way to return result.