debugged function to get values from a popupmenu and removed reinitialization of vectors