implemented and tested relation validation