adding devicePixelRatio to resize function