move expiration check to contains so that it returns false if the value is expired