Replaced printf by cerr in case of validation error