make sure stdin handler is installed only once