added duplicate handling for tiles