Trying shifting to a single function. This way we dont need to worry about locking