Fix isNaN issue