Added locks to callbacks