add --purge arg and array check