fixed out_of_bounds error