fixed random bug