modify the logic