Bug fix for exists