correct errors in code