added more checks for walls