added auto tile replacement