Bug fix for empty history scrolling problem