Bug fix and UI improvement