fixed bug in ama.inc