add detection mechanism