add error handling for ERASE closed to prevent FLOP segfault