format and solve the error