fix function return.
refactor