saving memory

added a few lines to clear the old ERSP after using it