fixed array input cleanup bug