add shim and fix bug