update schema and code