another js cleanup

fixed: Uncaught ReferenceError: data is not defined