fix None type issue