Add logical for error message