fix errors and bags