handling case where key is empty in search