adding signal handling