Changed database access code