Added better signal handeling and added singnal and exit_code to
exception