bar works correctly