fixed bug in schema upgrade script