fixed related tables in layer