fixing doc
adding check for array