added null check for association