bug fixes for lock support...think it works now...