moved code for setting empty src from unset to set. ouput invalid state invariants