Feature: Add locks

Not sure if this is the right way to use locks