fix errors thrown