bad code fix