fixed resetChart button not working and added debug output