Made terrain uploads thread-safe