added mutex and shorthanded next method