include layer in toJson conversion