fixed always showing AM bug