issue #30 bug fixed + bugs on index added