bad code fixed