Fixing if statement to utilize has_selector