can we add the same check as here https://github.com/rapid7/metasploit-framework/pull/3180/files ?