fixed #264 and improved the arrive.js implementation and performances