solved the problem, set array length as 4