fix fn returning issue