The bug was caused due to indicating threads were free. Due to msleep and other functions. Then we tried to access the old copy. However it had already been freed.