fixed: input bugs (e.g., inserting new cell when invalid characters are typed)