removed global variables in preload and fixed the loading screen bug

See commit message.