js popup cleanup