trying to solve weird shared memory error