fixed bug: aquired writelock was never released thus causing a deadlock
on the server