fixed deleting charts

The static path contains not only files, but also sometimes an assets directory. In any case,
this code is more stable, though not as pretty.