fixed shift of caps when a new layer is inserted in the model