added check for probability