added if statement to next closest on results page