Fix logic for javascript: href