Fix  duplicate code causing the script to not function (High Prio)