Fixed a bug when cancelling builds if the build load was high

- This was due to adding a require function call around the code