A note on closed geodesics