added check before getting related