now able to catch HTTP errors (404 etc) and fixed http to https redirections problems