Script. Fix None type issue