Added signal handling