bug fix
resultarray not getting reset