conditional check for jQuery