solved array bug