improve detection of https