protect input undefined. fixes #1