fixed sometimes layers cannot be merged