fix corner case when against the wall