If the interpreter performs a reset, then the BLE will be initialized again. Thus, there might be something wrong with the BLE database. Try adding a flag to avoid BLE re-initialization.