retrieving key values from db