The family of a recidivist flasher were so worried about his penchant for young girls they were considering having him GPS monitored.
But their efforts came too late after Laurence Bareham exposed himself on two occasions at the end of last year.
The convictions, entered in the North Shore District Court, came on the back of similar offending in the late 1990s.
And in 2007, Bareham was back in court after masturbating in front of two young girls in public, for which he was sentenced to a year of home detention.
Defence counsel Maria Mortimer said her client's family home was available to serve another community-based sentence but the police said there were concerns the house packed on to a park beside a school.
Ms Mortimer said Bareham had strong support from his family and his wife who were in the process of having him GPS monitored before the offending took place.
Judge Greg Davis said his decision "hinged on the need to protect the public from this type of behaviour".
He jailed Bareham for 18 months on the two counts of doing an indecent act.
"There has to be a line drawn under this and that line will be drawn today," he said.
In September, the defendant went into a Hospice charity shop. He entered a cubicle in the changing room but left the curtain partially open while he removed his pants.
He exposed his genitals to others in the shop before re-dressing and leaving.
Police found him shortly afterwards.
Bareham was bailed but three months later his penchant for sexually explicit public displays re-emerged.
He spotted two teenage girls on Takapuna beach heading into the water for a swim.
Bareham whistled at the pair to get their attention and when they turned, he took out his penis.
The ordeal for the 14 and 15-year-old continued as the man waded into the water while masturbating.
The younger victim wrote to the court saying she was "greatly disturbed" and now felt scared around older men.
Judge Davis called Bareham a "recidivist", who "it appears targets young girls and undertakes acts of this nature for your own sexual gratification".