reordered logic and removed another log