added getEnchantments and fixed a inf loop bug