add beforeSessionStart hook