fix bad code