check that AM and AM.loc isn't null