Fix infinit loop