grabbed some code changes from production, noted them here