fixed generating random