bugix for array index error when printing