fix select chart function