Update imports and fix condition