add except catch for KeyboardInterrupt