added some database function