Change deprecated api in Chrome