Fixed out-of-bound error