The masses of baryons containing two heavy quarks and their couplings to the corresponding quark currents are evaluated in the framework of NRQCD sum rules. The coulomb-like corrections in the system of doubly heavy diquark are taken into account, and the contribution of nonperturbative terms coming from the quark, gluon and mixed condensates as well as the product of quark and gluon condensates, is analyzed. The higher condensates destroy the factorization of baryon and diquark correlators and provide the convergency of sum rule method. As a result the accuracy of estimates is improved.