fixed javascript reference problems