move choose function to popup layout