Function for checking local DB