forgot to check array length