removed printf statements from database write