Changed code to use appSettings file