update app and db