added checking for running on cloudfoundry or locally