fixed the out of bound bug.. finally -_-