candidate: Although AMC officials hesitated to cast Cranston due to his previous comedic role on " Malcolm in the Middle " , Gilligan cast him based on the actor 's past performance in the " X - Files " episode " Drive " , which Gilligan wrote .