Fixed database connection error regarding blank values trying to write
to the database