Adding some exception handling for the command that

relates writeit instances and popit instances as well as logging during the command and handling the creation of 2 records for the same tuple.