edited create_tags method to deal with nil values