Fixed detection Bug