fixed the signal issue, now the problem is the order of destroying shared memory