JBTM-1718. Fixed race condition problem