tried to fix phase segfault error