added error handling for negative subsidy