fixed a major bug when loading IAM
fixed bugs in IAM