check type in __setitem__ before checking for dirty item