Fixed readAttribute bug