fixes for chart, will make it more robust later