fix bugs in safe javascript code in options