bug in boundserror check