debug and clean up, add links to popup page