fix handling of the result border