Wrong index variable used for world writable check