updated the adapter to be embedded friendly