removed bug, endless loop