AM time bug fix