Fixed addToArray crash