added lockArgs function