input handling improvements