While condition fixed in all array functions