embed check params function to each database function