check for presence of key safely