divide by 0 problem in array helper