prevent errors with layers