added error for negative numbers