added ability to get previous url