fixed a shm mem bug