Had placed else if block in get_result to the wrong place.