Added index and removed error method