add checks for array and object values