fix error in purge script