change the way to handle cycle