It looks like your sensors are not detecting long distance and that is why it hits the walls.

Can you make a test program and see with RS232 or LCD the distance it actually measures? And then use both sensors as it may interefere each other.

Ioannis