Added proper history navigation