fix: Variable scope problem