Stop scanning function implemented