adding 1s sleep to main thread for stability