Added condition to correct undefined to false if there's no input at all.