functional update database when app open