fix for environment from realm
merging master