if statement and link resource