handling invalid key-val insertion

check validity of key-val pair, before inserting.

If invalid pair:
   ignore the input.
Else:
   check for eviction and then set value.