fix segfault
moving tests around