move redirect to search results to success function