Fix function return problem