fix swift compatibility