fixed javascript variable conflict