Updated if block to run if there are attribute properties