This needs to be: `_setStatus(STATUS_INACTIVE, reason || "explicit_close");`

This function needs to be moved inside of the `_close()` function closure so it gets the `reason` variable.