Bound check error fixed