implementing touch detect