The Magistrate shall check the time of arrest by questioning the arrested person and if he finds that a person has been detained unlawfully, he shall report the matter to the Sessions Judge, who shall make an appropriate order in the matter ...