Fix position of custom_tgz logic