Added additional code to detect changes in database schema