encoding array has some problem