fixed bugs in detected(0 function in data class