Fixing issue with this script