fixed the script a bit more