Fixed thread sleeping error. Fixed to sleep for milliseconds