fixed bug in unit checking for relations