removed sleep in thread