Fix bug with popup callback