fixing terrain bug