update conditional statement for nodejs