Add signal checks to each function entry