bug fixing for popup