adding the function for detect