in his function as magistrate