added sql key lookup