fixed a bug in storing tags