Fixed to work for other scripts