Fixes javascript error