changed code that google chrome deprecated