The city of Honolulu has approved a law banning pedestrians from crossing a street while viewing a mobile electronic device.

At a bill-signing ceremony, Honolulu Mayor Kirk Caldwell said the “distracted pedestrian” law is needed because so many people are hit by vehicles on crosswalks.

“Sometimes I wish there were laws we did not have to pass, that perhaps common sense would prevail,” the Mayor reportedly said. “But sometimes we lack common sense.”

Fines for initial violations will range from $15 to $35, with additional violations incurring fines of $75 to $99.

The law goes into effect October 25.