working stored procedure with a list