fixing type signature end conditions