Bug fix for different environments