fixed check for tags