random memory problem, but work