Added some random sleep() due to possible race condition or something