added error if input = 0