adding db write mutex