improve input-handling