fixed bug in swift fallback to legacy