fix bug with inverted walls