fix layering in jmap