added check validation for head and tail classes
made todo
merge relationship