bug fix for popup