Fixed a missing segment of code (should have added it, stupid mistake)