simple javascript patches