added function to check match between material and phase / added function to get string easily from a popupmenu