Fixed javascript helper