replacing comparing to debug with BT.RM_DEBUG constant