fix js handling