adding support for input objects which have readline method
fixing typo