fixed null pointer exception when chartscript is deleted