fix put and del operations to use key function when present