Bug fix for