added new variable and conditional statement to database_write
added a variable and a conditional statement to database load