Added detection functionality