Testing mongodb write issue