inf-loop Error fixed