issue 1 fix

Added if else statements to determine if tags exist first before running
things