Added signature checking function.