Database Functions updated