added proper locking to windows