fixed am pm bug