encap bugfixing