Fix undefined variable due to pre commit refactoring