bug fix to use schema as dict