fixed errors order
fixed bug on reporting error
fixed bug