Added check for non-arrays