fix double enqueue bug and adding global settings