clean up new Date().getTime() overload in attach function