fix error messages

bug fix on redeclare