Fixed the weird issue with adding objects to the empty array