Fixing issue with loader.js not triggering oncomplete() for empty data array