fix critical errors