add helper functions for checking key existence