how to deploy && chown based on flag