fixes javascript error thrown in console