resolves a lot of bugs related to the borders