However, her film career was not as successful as she had hoped it would be. Following the commercially successful "Desperately Seeking Susan", her 1986 film "Shanghai Surprise"—where she starred with her then husband Sean Penn—was a critical and box-office failure, prompting Madonna to comment that she "struggled to come to terms with her character in "Shanghai Surprise", because the innocence and repressed personality I was required to portray was so at variance with my own character." Continuing to struggle with her film career, Madonna was unsure of her ability to choose a good script, and film producers were less sure about backing her up. Madonna felt that comedy was more of her repertoire, and proceeded to sign a comedy film titled "Slammer", written by Andrew Smith and Ken Finkleman. She wanted to play the part of a street smart girl called Nikki Finn, who was jailed for a crime she did not commit. However, in light of the bad publicity surrounding her and Penn, and of the very public failure of "Shanghai Surprise", Madonna had to persuade producers Rosilyn Heller and Bernard Williams, as well as Warner Bros., that she was up for the part. In addition, she wanted friend James Foley to direct the film. Foley had been Penn's best man at his marriage to Madonna, and had directed the music videos of Madonna's singles "Live to Tell" (1986) and "Papa Don't Preach" (1986). He was ecstatic at having the opportunity to make a major feature film, as previously he had only directed the small-budgeted film "At Close Range", starring Penn. As author Andrew Morton pointed out in his biography on Madonna, "the combination of a dubiously talented movie star and a first-time movie director hardly guaranteed a box-office hit, but the film received the go-ahead from Warner, who wanted to encache more on Madonna's success." Madonna plowed gamely on, saying: "All Warner's executives were real positive about the project. It was a process—with the writers—of honing the script, making it better." Casting for the film began as soon as Madonna had signed up for it. Griffin Dunne was signed to play the part of Loudon Trott, a lawyer whose job was to help Nikki get on a bus, after she was released. Initially, Madonna had thought of asking Penn to play the part of Detective Bellson, but Penn was serving a 60-day jail term, having violated the probation he received in 1986, for assaulting a friend of Madonna and attacking an extra on the set of "At Close Range".