added check for foreign key in getTrackingSessionPoints