Changed database stuff for local variable