Changed AM_TYPE condition