more logic adjustments to try to make it work on prod as well as dev