added a check for the stdin format