Article 239 authorizes the police to detain a person if he/she is caught in the act, if there was sufficient evidence that the person had been involved in a punishable offence for which there was a provision for pretrial detention.