fix ratio distribution bug