I don't get what you're doing here, and the tags variable appears to be unused.  Was this an old debugging thing you forgot to remove?