collects static declarations at top
updtes error messages