adding tag write functionality, correcting tag read handling