fix search_last_tag method