some schema changes and logic change