added lock of mutex in readstate function, added missing return true, made movestepextendednoread with writewait