change array length correctly