fixed a bug where content couldve been writter twice