added error message for declaration conflicts
some changes