pass id variable to results function