fixing a stored procedure that was returning rows