print error if needed