Refactoring, add previous url after searching