fixed bug with re-ordered sorting layers