[Front-end] [#171] Added logic that reroutes to previous location