Fixes infinite loop
Merge branch 'hotfix/infinite_loop_fix'