bug fix in plot_energy_levels function dispatch