Added updated javascript with loggin