Hi Nasir,

Make sure you trap the signal in the thread you put your main sleep,
otherwise maybe the thread finishes and the trap goes nirvana...

Regards
Florian