Fixed a bug where the tool would hang indefinitely