set up code for popup menu