corrected border check
merge