Fixed bad code