Fixed a bug that caused the whole system to hang