better error handling, allow writing one tag only