Add stop build function

Closes #1