Added better error handling for lazyloading file