changes to handle signal