copied procs for ricks database