Added beforeAddTag callback