made function to stop G2