added code to be embers compatible