fix stored proc