Handling sync between popup and opts