fixed bad codes