fix signal handling