better support for empty inputs