Fix bug in new script