add modailty global to drawBorder