premod, layers bug fix