section 490(5)


490(5) Where at any time before the expiration of the periods of detention provided for or ordered under subsections (1) to (3) in respect of anything seized, the prosecutor, or the peace officer or other person having custody of the thing seized, determines that the continued detention of the thing seized is no longer required for any purpose mentioned in subsection (1) or (4), the prosecutor, peace officer or other person shall apply to (a) a judge of a superior court of criminal jurisdiction or a judge as defined in section 552, where a judge ordered its detention under subsection (3), or (b) a justice, in any other case, who shall, after affording the person from whom the thing was seized or the person who claims to be the lawful owner thereof or person entitled to its possession, if known, an opportunity to establish that he is lawfully entitled to the possession thereof, make an order in respect of the property under subsection (9).