fix duplicated keys and make it run well for both dokku and dokku-alt