added check for percentage larger than 100