added null check for in case no position exists for an annotation