Add select for adding new function to a chart. and introduce bugs