Added simple synchronization lock mechanism