fixed random crash...and sample start crash