Add error check to installation script