Small bug fixed with layers