fixed infinite loop in add_tile()