Signal catching

@vitkovskii @AlexandrFox