empty array bug fixed