Fixed problem with endArray