bug fixed the hard stuff
fixed signal handling as well