fixes error in js