fixed out-of-bounds issue with 3765