Fixed empty array issue