Added Database functions in hopes of fixing concurrency issues