changes to support embedding