trying to remove the inf loop