Fixed the stored procedure.