now works with multiple schemas