fix bug with encastling