fixing bounds error