Main: added signal handling