Fixed index to not use the new keyword. Added fix for bug where type does not exist