added ctrl+c exception handling for clean exit