fix out bounds error