fix bugs in at