added a check to remove the unnecessary error in powershell