array works, getting error