fix layers bug #1