edited applicationContext per instructions to improve database connection