Fix for layer arrange bug