fix segfaut introduce in previous patch