adding nil test in setBrewPath and removing unnecessary invalid path constant and exception handler