updated code to get database information from environment variable