add order function for relationship