fix bug for error print