added loading environmental variables, database connection and text saving