added indexes
fixed as per changes suggested