added key database control