Handled the corner case when the wall is empty