Fixed None type issue