fix bug if the tags is empty