Added function to check for loaded js files
Changes for slower servers