Replaced nanosleep with correct function (msleep)