Fixes the bug shown in last commit