fix bug in the method to get tags