fixed "previous" bug