added initial files for handling system exit signal and freeing all memory