better detection of border color