The list is filtered, so we need to not use index of the input. Fixes: Lua error: attempt to compare string with nil