Trapping cold polar molecules on chips