fixed bug of getting the attribute and loading main