popup scripts updated for buttons