undefined input fix