fix segv: wrong reference