testing database access for apps, changed some functions