Added AM_TYPE condition