Replacing state on loading with history api