small fix for layer > 2