fix unexpected return problem