writting to mongodb ERROR