preparation before database access