fixed drawBorder method