change it to a recursive sproc