Javascript: Self involked anonymous function