Fixing inArray problem