It should be made upon motion of the prosecution before resting its case