added trace_function to session