fixed bug in as1997 and re-arranged to let the bug show up