add showErrorWindowWithError in ViewController and delete associate duplicated code