add ordering based on foreignkey