try to fix array length bug