quashing criminal proceedings