Bug fix for popup mode
3.0.1