Added database function