improved embed checking