Fixed bugs in Index

still in testing