Added the no-check-certificate cause it fails otherwise
Updated if statement