implemented auto border