no errors but array printing out empty