bug fix: now works with custom Swift classes