added closure to all js