modify sample javascript