reverted and merged part of embed fix