Bug fix thanks to vovakkk @github