changed db creds to dynamic host detection switch