Modified the preprocessor script to sleep when data is empty in the mongo database