fixed a bug in splitting density grid.py