handle process signal reception.
bug fixes for signal case.