Fixed check for array