changed array to nsarray